<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>    
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String contextPath = request.getContextPath();
%>
<hr>

<!-- //Wrapper 폼을주기위한 div-->
<div id="wrapper">
  <!-- Contenter_Sub 폼을주기위한 div -->
  <div id="container_sub">
	<!-- Content_List 폼을주기위한 idv-->
	<div id="sub_page_bg4"></div>
	<!-- Sub Page Background -->
    <div id="content_list">
     <div class="title">
      
      <div class='sub_title'>
	<ul>
	<li>데이트코스</li>
<li class='stitle'>이만하면 나도 연애 고수!!</li>
</ul>
</div>

<div class='navig'>
<ul>
<li class='frst'><img src='../image/all/home_icon.png' align='absmiddle' width='13' height='13'><a href='<%=contextPath %>/main/index.do'>HOME</a></li>
<li>회원서비스</li>
<li>데이트코스</li>
</ul></div>

<!-- sub_menu-->
<ul class='sub_menu'>		
	  <ul class="sub_tab">
		
		<li><a class='rollover' href="<%=contextPath%>/propose/write.do">프로포즈</a></li>
		<li><a class='rollover' href="<%=contextPath%>/propose/search.do">이상형찾기</a></li>
		<li><a class='rollover' href="<%=contextPath %>/recommend/allList.do">회원현황</a></li>
		<li><a class='rollover' href="<%=contextPath %>/eventBoard/list.do">파티&미팅</a></li>
		<li><a class='over' href="<%=contextPath %>/dcourseBoard/list.do">데이트코스</a></li></ul>
	 </ul>				
 <!-- <div class="title"> 닫는 div-->
</div>

<style>
	ul,ol,li {list-style:none;}
	li {display:inline;}
</style>
<script src="http://www.wedaehan.com/js/viewimageresize.js"></script>

<!-- 게시물 읽기 시작 { -->

<article id="bo_v">
  <header>
    <h1 id="bo_v_title">
	<span style="color:#c1454a; font-size:22px; ">글제목 : ${dcourseBoard.title} </span>
			
 	<section id="bo_v_info" style="text-align:right;">
     <h2>페이지 정보</h2>
        <strong>작성자: <span class="sv_member">${dcourseBoard.writer_name}</span></strong>
        <strong><span class="sound_only">작성일</span><fmt:formatDate value="${dcourseBoard.posting_date}" pattern="YY-MM-dd"/></strong>
     </section>
     </h1>
    </header>

<!-- 게시물 상단 버튼 시작 { -->
<div id="bo_v_top">
   <ul class="bo_v_nb" style="float:left;">
	  <c:if test="${nextMessage==1}">
	  <li><a href="<%=contextPath %>/dcourseBoard/detail.do?num=${nextDcourseBoard.num}" class="btn_b01">다음글</a></li>
	  <li style="line-height:3em;">&nbsp;&nbsp;<a href="<%=contextPath %>/dcourseBoard/detail.do?num=${nextDcourseBoard.num}" ><b>제목 :</b><font color="blue">${nextDcourseBoard.title}</font></a> </li><br><br>
	  </c:if>
	  
	  <c:if test="${nextMessage==0}">
	  <li><a href="#" class="btn_b01">다음글</a></li>
	  <li style="line-height:3em;">&nbsp;&nbsp; 이 글이 마지막 글입니다. </li><br><br>
	  </c:if> 
	  
	  <c:if test="${prevMessage==1}">
	  <li><a href="<%=contextPath %>/dcourseBoard/detail.do?num=${prevDcourseBoard.num}" class="btn_b01">이전글</a></li>
	  <li style="line-height:3em;">&nbsp;&nbsp;<a href="<%=contextPath %>/dcourseBoard/detail.do?num=${prevDcourseBoard.num}" ><b>제목 :</b><font color="blue">${prevDcourseBoard.title}</font></a></li><br><br>
	  </c:if>
	  
	  <c:if test="${prevMessage==0}">
	  <li><a href="#" class="btn_b01">이전글</a></li>
	  <li style="line-height:3em;">&nbsp;&nbsp; 이 글이 첫번째 글 입니다. </li><br><br>
	  </c:if>	
	</ul>
        
    <ul class="bo_v_com" style="float:right;">
      <li><a href="<%=contextPath %>/dcourseBoard/reply.do?num=${dcourseBoard.num}" class="btn_b01">답변</a></li>            
      <li><a href="<%=contextPath %>/dcourseBoard/update.do?num=${dcourseBoard.num}" class="btn_b01">수정</a></li>            
      <li><a href="<%=contextPath %>/dcourseBoard/delete.do?num=${dcourseBoard.num}" class="btn_b01" onclick="location.href='dcourseDelete.do?num=${dcourseBoard.num}'">삭제</a></li>                                                
      <li><a href="<%=contextPath %>/dcourseBoard/list.do" class="btn_b01">목록</a></li>
      <li><a href="<%=contextPath %>/dcourseBoard/write.do" class="btn_b02">글쓰기</a></li>
    </ul>
</div>
 
<section id="bo_v_atc" style="float:center; clear:both; margin:0 autp;  padding:50px;">
   <h2 id="bo_v_atc_title"></h2>
   <div id="bo_v_img"></div>
${dcourseBoard.content}<br>
	<c:if test="${!empty list1}">
		<c:forEach items="${list1}" var="file">
			<div style="width:500;  height:300">
				<img src="/wedding/upload/${file}" width="500" height="300"> <br>
			</div>
		</c:forEach>
	</c:if>
<!-- 본문 내용 시작 { -->
<div id="bo_v_con" style="text-align:left;">
	
</div>
<div id="bo_v_act"></div>
</section>

<!-- <script>
// 글자수 제한
var char_min = parseInt(0); // 최소
var char_max = parseInt(100); // 최대
</script>
 -->
<!-- 댓글 시작 { -->
<section id="bo_vc">
    <h2>댓글목록</h2>
   	<c:if test="${count > 0}">
    	<c:forEach var="article" items="${list}">
    	 <p id="bo_vc_empty">
    	 -----------------------------------------------<br>
    	 <b>작성자 :</b>${article.writer_name}<br> 
    	 <b>글제목 :</b>${article.title}<br> 
    	 <b>내용 :</b>${article.content}<br> 
    	 <b>날짜 :</b>${article.posting_date}<br>
    	 -----------------------------------------------
    	 </p>
     	</c:forEach>
    </c:if>
    <c:if test="${count == 0}">
    	<p id="bo_vc_empty">등록된 댓글이 없습니다.</p>
    </c:if>
</section>
<!-- } 댓글 끝 -->

<!-- } 댓글 쓰기 끝 -->
 
<div id="bo_v_bot">
  <ul class="bo_v_nb" style="float:left;">
  <c:if test="${nextMessage==1}">
  <li><a href="<%=contextPath %>/dcourseBoard/detail.do?num=${nextDcourseBoard.num}" class="btn_b01">다음글</a></li>
  <li style="line-height:3em;">&nbsp;&nbsp;<a href="<%=contextPath %>/dcourseBoard/detail.do?num=${nextDcourseBoard.num}" ><b>제목 :</b><font color="blue">${nextDcourseBoard.title}</font></a> </li><br><br>
  </c:if>
  
  <c:if test="${nextMessage==0}">
  <li><a href="#" class="btn_b01">다음글</a></li>
  <li style="line-height:3em;">&nbsp;&nbsp; 이 글이 마지막 글입니다. </li><br><br>
  </c:if> 
  
  <c:if test="${prevMessage==1}">
  <li><a href="<%=contextPath %>/dcourseBoard/detail.do?num=${prevDcourseBoard.num}" class="btn_b01">이전글</a></li>
  <li style="line-height:3em;">&nbsp;&nbsp;<a href="<%=contextPath %>/dcourseBoard/detail.do?num=${prevDcourseBoard.num}" > <b>제목 :</b><font color="blue">${prevDcourseBoard.title}</font></a></li><br><br>
  </c:if>
  
  <c:if test="${prevMessage==0}">
  <li><a href="#" class="btn_b01">이전글</a></li>
  <li style="line-height:3em;">&nbsp;&nbsp; 이 글이 첫번째 글 입니다. </li><br><br>
  </c:if>
  
  </ul>
  
        
  <ul class="bo_v_com" style="float:right;">
  <li><a href="<%=contextPath %>/dcourseBoard/dcourseReply.do?num=${dcourseBoard.num}" class="btn_b01">답변</a></li>            
      <li><a href="<%=contextPath %>/dcourseBoard/update.do?num=${dcourseBoard.num}" class="btn_b01">수정</a></li>            
      <li><a href="<%=contextPath %>/dcourseBoard/delete.do?num=${dcourseBoard.num}" class="btn_b01" onclick="location.href='dcourseDelete.do?num=${dcourseBoard.num}'">삭제</a></li>                                                
      <li><a href="<%=contextPath %>/dcourseBoard/list.do" class="btn_b01">목록</a></li>
      <li><a href="<%=contextPath %>/dcourseBoard/write.do" class="btn_b02">글쓰기</a></li>
  </ul>
</div>
    <!-- } 링크 버튼 끝 -->

</article>
<!-- } 게시판 읽기 끝 -->

<script>

function board_move(href)
{
    window.open(href, "boardmove", "left=50, top=50, width=500, height=550, scrollbars=1");
}
</script>

<script>
$(function() {
    $("a.view_image").click(function() {
        window.open(this.href, "large_image", "location=yes,links=no,toolbar=no,top=10,left=10,width=10,height=10,resizable=yes,scrollbars=no,status=no");
        return false;
    });

    // 추천, 비추천
    $("#good_button, #nogood_button").click(function() {
        var $tx;
        if(this.id == "good_button")
            $tx = $("#bo_v_act_good");
        else
            $tx = $("#bo_v_act_nogood");

        excute_good(this.href, $(this), $tx);
        return false;
    });

    // 이미지 리사이즈
    $("#bo_v_atc").viewimageresize();
});

function excute_good(href, $el, $tx)
{
    $.post(
        href,
        { js: "on" },
        function(data) {
            if(data.error) {
                alert(data.error);
                return false;
            }

            if(data.count) {
                $el.find("strong").text(number_format(String(data.count)));
                if($tx.attr("id").search("nogood") > -1) {
                    $tx.text("이 글을 비추천하셨습니다.");
                    $tx.fadeIn(200).delay(2500).fadeOut(200);
                } else {
                    $tx.text("이 글을 추천하셨습니다.");
                    $tx.fadeIn(200).delay(2500).fadeOut(200);
                }
            }
        }, "json"
    );
}
</script>
<!-- } 게시글 읽기 끝 -->		
		<div id="blank">&nbsp;</div>
		</div>
		<!-- //content_list -->
	</div>
	<!-- //contenter_sub -->
</div>
<!-- //wrapper -->

<script>
$(document).ready(function(){
  $(window).scroll(function () {
   if ($(this).scrollTop() > 10) { 
        $('#back-top').fadeIn();
   } else {
       $('#back-top').fadeOut();
   }
  });

  $('#back-top').click(function () {
   $('body,html').animate({
        scrollTop: 0
   }, 200);
        return false;
  });
});
</script>
<style>
#back-top {
 position: fixed;
 bottom: 100px; /* 부라우저 밑에서 위로 떨어질 높이설정  */
 left: 90%;
 margin:0px;  /* 부라우저 중앙에서 우측으로 떨어질 거리설정  */
 z-index:999;
 display:none;
}
</style>
<div id="back-top">
    <a href="#wrap"><img src="/image/all/go_top.png" width="60" height="60" alt="위로가기"></a>
</div>
<!-- } 콘텐츠 끝 -->

<hr>